/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bkt.model.hr.leave;

import bkt.model.person.Employee;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Temporal;
import org.hibernate.annotations.GenericGenerator;

/**
 *
 * @author hashcode
 */
@Entity
public class LeaveApplication implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid2")
    private String id;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date applicationDate;
    private String comment;
    private double duration;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateStart;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateEnd;
    private String status;
    private String mgrComment;
    private Employee manager = new Employee();
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date appovedDate;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date declinedDate;
    private Employee approvedUser = new Employee();
    private Employee declinedUser = new Employee();

    private LeaveType leaveType = new LeaveType();

    public Date getApplicationDate() {
        return applicationDate;
    }

    public void setApplicationDate(Date applicationDate) {
        this.applicationDate = applicationDate;
    }

    public Date getAppovedDate() {
        return appovedDate;
    }

    public void setAppovedDate(Date appovedDate) {
        this.appovedDate = appovedDate;
    }

    public Employee getApprovedUser() {
        return approvedUser;
    }

    public void setApprovedUser(Employee approvedUser) {
        this.approvedUser = approvedUser;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public Date getDateEnd() {
        return dateEnd;
    }

    public void setDateEnd(Date dateEnd) {
        this.dateEnd = dateEnd;
    }

    public Date getDateStart() {
        return dateStart;
    }

    public void setDateStart(Date dateStart) {
        this.dateStart = dateStart;
    }

    public Date getDeclinedDate() {
        return declinedDate;
    }

    public void setDeclinedDate(Date declinedDate) {
        this.declinedDate = declinedDate;
    }

    public Employee getDeclinedUser() {
        return declinedUser;
    }

    public void setDeclinedUser(Employee declinedUser) {
        this.declinedUser = declinedUser;
    }

    public double getDuration() {
        return duration;
    }

    public void setDuration(double duration) {
        this.duration = duration;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public LeaveType getLeaveType() {
        return leaveType;
    }

    public void setLeaveType(LeaveType leaveType) {
        this.leaveType = leaveType;
    }

    public Employee getManager() {
        return manager;
    }

    public void setManager(Employee manager) {
        this.manager = manager;
    }

    public String getMgrComment() {
        return mgrComment;
    }

    public void setMgrComment(String mgrComment) {
        this.mgrComment = mgrComment;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LeaveApplication)) {
            return false;
        }
        LeaveApplication other = (LeaveApplication) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "LeaveApplication[id=" + id + "]";
    }
}
